{php}
//权限控制
$addurl="facrm/contract/index/add";
$raddurl="facrm/contract/receivables/add";//添加回款链接

if(isset($action)&&$action=='lists'){
    $addurl="facrm/contract/index/contractadd";
    $raddurl="facrm/contract/receivables/receivablesadd";
}

{/php}

<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        {:build_heading(null,FALSE)}
        <ul class="nav nav-tabs" data-field="scene_id">
            {foreach name="scene_list" item="vo"  index="i" }
            <li {if condition="$i eq 1"}class='active'{/if}><a  href="#t-{$key}" data-value="{$key}" data-toggle="tab">
            {$vo}<span class="pull-right-container {$key}"><small class="label pull-right bg-orange"></small></span>
        </a></li>
            {/foreach}
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="contract_table">
                        <div id="toolbar" class="toolbar">
                            <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>

                            <a class="btn btn-info btn-print btn-disabled disabled {:$auth->check('facrm/contract/index/print')?'':'hide'}" >
                                <i class="fa fa-print"></i> {:__('打印')}</a>


                            <a href="javascript:;" class="btn btn-success btn-dialog {:$auth->check($addurl)?'':'hide'}" data-url="{$addurl}" title="{:__('Add')}" data-area='["100%","100%"]' >
                                <i class="fa fa-plus"></i> {:__('Add')}</a>
                            <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('facrm/contract/index/recyclebin')?'':'hide'}"
                               href="{:url('facrm/contract.index/recyclebin')}" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('回收站')}</a>
                            <a href="javascript:;" data-url="{:url('facrm/contract.index/diyorder')}" class="btn btn-primary btn-dialog  " title="{:__('合同排列')}"><i class="fa fa-arrows"></i>{:__('排列')}</a>

                        </div>
                        <table id="contract" class="table table-striped table-bordered table-hover table-nowrap"
                               data-operate-edit="{:$auth->check('facrm/contract/index/edit')}"
                               data-operate-del="{:$auth->check('facrm/contract/index/del')}"
                               data-operate-add="{:$auth->check('facrm/contract/index/add')}"
                               data-operate-raddurl="{:$auth->check($raddurl)}"

                               width="100%">
                        </table>

                    </div>

                </div>
            </div>

        </div>
    </div>
</div>
<script>
    var scene_list={:json_encode($scene_list)};
    var from_type="{:input('from_type')}";
    var raddurl='{$raddurl}';
    var customer_id="{:input('customer_id','','intval')}";
</script>